package cn.operation.api;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.support.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;

/**
 * Spring Boot 应用启动类
 *
 * Created by Felix on 17/8/22.
 */
//// Spring Boot 应用的标识
//@SpringBootApplication
//// mapper 接口类扫描包配置
//@MapperScan("cn.operation.base")
//@ComponentScan(basePackages = "cn.operation")
//public class ApiApplication {
//
//    public static void main(String[] args) {
//        // 程序启动入口
//        // 启动嵌入式的 Tomcat 并初始化 Spring 环境及其各 Spring 组件
//        SpringApplication.run(ApiApplication.class,args);
//    }

//}

// Spring Boot 应用的标识
@SpringBootApplication
// mapper 接口类扫描包配置
@MapperScan("cn.operation.base")
@ComponentScan(basePackages = "cn.operation")
public class ApiApplication extends SpringBootServletInitializer {

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(ApiApplication.class);
    }


    public static void main(String[] args) throws Exception {
        SpringApplication.run(ApiApplication.class, args);
    }

}


